<template>
    <div class="app-container">
        <el-tabs v-model="activeNames">
            <el-tab-pane label="密胺外销价格表" name="first">
                <el-form ref="MAWXJGBForm" :model="MAWXJGBForm" :inline="true">
                    <el-form-item label="品名" prop="PM">
                        <el-input v-model="MAWXJGBForm.PM" placeholder="请输入品名" clearable @keyup.enter.native="handleQueryMA"/>
                    </el-form-item>
                    <el-form-item label="产品货号" prop="CPHH">
                        <el-input v-model="MAWXJGBForm.CPHH" placeholder="请输入产品货号" clearable @keyup.enter.native="handleQueryMA"/>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryMA">搜索</el-button>
                        <el-button  icon="el-icon-refresh" size="mini" @click="resetQueryMA">重置</el-button>
                    </el-form-item>
                </el-form>

                <el-row :gutter="10" class="mb8">
                    <el-col :span="1.5">
                        <el-button icon="el-icon-download" plain size="mini" type="warning" @click="handleExportMA">导出</el-button>
                    </el-col>
                    <el-col :span="1.5">
                        <el-button icon="el-icon-upload" plain size="mini" type="success" @click="handleImportMA">导入</el-button>
                    </el-col>
                    <el-col :span="1.5">
                        <el-button icon="el-icon-delete" plain size="mini" type="primary" @click="handleUpdateMA">批量修改单价</el-button>
                    </el-col>
                </el-row>

                <el-table :data="MAWXJGBTable">
                    <el-table-column type="selection"/>
                    <el-table-column label="图片" prop="TP" align="center"/>
                    <el-table-column label="品名" prop="PM" align="center"/>
                    <el-table-column label="产品货号" prop="CPHH" align="center"/>
                    <el-table-column label="规格" prop="GG" align="center"/>
                    <el-table-column label="单位" prop="DW" align="center"/>
                    <el-table-column label="A1单价" prop="ADJ" align="center"/>
                    <el-table-column label="A1比率" prop="ABL" align="center"/>
                    <el-table-column label="美金汇率" prop="MJHL" align="center"/>
                    <el-table-column label="A1美金" prop="AMJ" align="center"/>
                    <el-table-column label="A1克重" prop="AKZ" align="center"/>
                    <el-table-column label="模具克重" prop="MJKZ" align="center"/>
                    <el-table-column label="A5单价" prop="A5DJ" align="center"/>
                    <el-table-column label="A5比率" prop="A5BL" align="center"/>
                    <el-table-column label="A5美金" prop="A5MJ" align="center"/>
                    <el-table-column label="A5克重" prop="A5KZ" align="center"/>
                    <el-table-column label="装箱数" prop="ZXS" align="center"/>
                    <el-table-column label="长" prop="C" align="center"/>
                    <el-table-column label="宽" prop="K" align="center"/>
                    <el-table-column label="高" prop="G" align="center"/>
                    <el-table-column label="立方" prop="LF" align="center"/>
                    <el-table-column label="毛重" prop="MZ" align="center"/>
                    <el-table-column label="净重" prop="JZ" align="center"/>
                    <el-table-column label="备注" prop="BZ" align="center"/>
                    <el-table-column label="操作" fixed="right">
                        <template slot-scope="scope">
                            <el-button icon="el-icon-edit" size="mini" type="text" @click="handleUpdate1(scope.row)">修改</el-button>
                        </template>
                    </el-table-column>
                </el-table>

                <pagination  :total="totalMA" :page.sync="queryParamsMA.pageNum"
          :limit.sync="queryParamsMA.pageSize" @pagination="getListMA" />

            <el-dialog :title="titleMA" :visible.sync="openMA" append-to-body width="400px">
                <el-form ref="MALPLDJSZForm" :model="MALPLDJSZForm" :inline="true">
                    <el-form-item label="A1单价调价幅度(%):" prop="A1DJDJFD">
                        <el-input v-model="MALPLDJSZForm.A1DJDJFD" placeholder="请输入A1单价调价幅度(%)" clearable></el-input>
                    </el-form-item>
                    <el-form-item label="A5单价调价幅度(%):" prop="A5DJDJFD">
                        <el-input v-model="MALPLDJSZForm.A5DJDJFD" placeholder="请输入A5单价调价幅度(%)" clearable></el-input>
                    </el-form-item>
                </el-form>

                <div slot="footer" class="dialog-footer">
                    <el-button type="primary" @click="submitMA">确定</el-button>
                    <el-button @click="cancelMA">取消</el-button>
                </div>
            </el-dialog>
            </el-tab-pane>
            <el-tab-pane label="塑料外销价格表" name="second">
                <el-form :model="SLWXJGBForm" ref="SLWXJGBForm" :inline=true>
                    <el-form-item label="品名" prop="PM">
                        <el-input v-model="SLWXJGBForm.PM" placeholder="请输入品名" clearable @keyup.enter.native="handleQuerySL"/>
                    </el-form-item>
                    <el-form-item label="产品货号" prop="CPHH">
                        <el-input v-model="SLWXJGBForm.CPHH" placeholder="请输入产品货号" clearable @keyup.enter.native="handleQuerySL"/>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuerySL">搜索</el-button>
                        <el-button  icon="el-icon-refresh" size="mini" @click="resetQuerySL">重置</el-button>
                    </el-form-item>
                </el-form>

                <el-row :gutter="10" class="mb8">
                    <el-col :span="1.5">
                        <el-button icon="el-icon-download" plain size="mini" type="warning" @click="handleExportSL">导出</el-button>
                    </el-col>
                    <el-col :span="1.5">
                        <el-button icon="el-icon-upload" plain size="mini" type="success" @click="handleImportSL">导入</el-button>
                    </el-col>
                    <el-col :span="1.5">
                        <el-button icon="el-icon-delete" plain size="mini" type="primary" @click="handleUpdateSL">批量修改单价</el-button>
                    </el-col>
                </el-row>

                <el-table :data="SLWXJGBTable">
                    <el-table-column type="selection"/>
                    <el-table-column label="图片" prop="TP" align="center"/>
                    <el-table-column label="品名" prop="PM" align="center"/>
                    <el-table-column label="产品货号" prop="CPHH" align="center"/>
                    <el-table-column label="规格" prop="GG" align="center"/>
                    <el-table-column label="单位" prop="DW" align="center"/>
                    <el-table-column label="比率" prop="BL" align="center"/> 
                    <el-table-column label="美金汇率" prop="MJHL" align="center"/>
                    <el-table-column label="美金售价" prop="MJSJ" align="center"/>
                    <el-table-column label="模具克重" prop="MJKZ" align="center"/>
                    <el-table-column label="材质" prop="CZ" align="center"/>
                    <el-table-column label="装箱数" prop="ZXS" align="center"/>
                    <el-table-column label="长" prop="C" align="center"/>
                    <el-table-column label="宽" prop="K" align="center"/>
                    <el-table-column label="高" prop="G" align="center"/>
                    <el-table-column label="立方" prop="LF" align="center"/>
                    <el-table-column label="毛重" prop="MZ" align="center"/>
                    <el-table-column label="净重" prop="JZ" align="center"/>
                    <el-table-column label="备注" prop="BZ" align="center"/>
                    <el-table-column label="操作" fixed="right">
                        <template slot-scope="scope">
                            <el-button icon="el-icon-edit" size="mini" type="text" @click="handleUpdate2(scope.row)">修改</el-button>
                        </template>
                    </el-table-column>
                </el-table>

                <pagination  :total="totalSL" :page.sync="queryParamsSL.pageNum"
          :limit.sync="queryParamsSL.pageSize" @pagination="getListSL" />

          <el-dialog :title="titleSL" :visible.sync="openSL" append-to-body width="400px">
                <el-form ref="SLLPLDJSZForm" :model="SLLPLDJSZForm" :inline="true">
                    <el-form-item label="单价调价幅度(%):" prop="DJDJFD">
                        <el-input v-model="SLLPLDJSZForm.DJDJFD" placeholder="请输入单价调价幅度(%)" clearable></el-input>
                    </el-form-item>
                </el-form>

                <div slot="footer" class="dialog-footer">
                    <el-button type="primary" @click="submitSL">确定</el-button>
                    <el-button @click="cancelSL">取消</el-button>
                </div>
            </el-dialog>

            </el-tab-pane>
        </el-tabs>
    </div>
</template>

<script>

    export default {
        data () {
            return {
                activeNames: 'first',
                titleMA: '',
                titleSL: '',

                openMA: false,
                openSL: false,

                //表单参数
                MAWXJGBForm: {},
                SLWXJGBForm: {},
                MALPLDJSZForm: {},
                SLLPLDJSZForm: {},

                MAWXJGBTable: [{
                    PM:'长方形大托盘',
                    CPHH:'YL018327',
                    GG:'68.5*51.5*3.4',
                    DW:'只',
                    ADJ:'公式：A1比率XA!克重',
                    ABL:'0.0146',
                    MJHL:'7.0000',
                    AMJ:'公式：A1单价/美金汇率',
                    AKZ:'2190',
                    MJKZ:'2190',
                    A5DJ:'公式：A5比率×A5克重',
                    A5BL:'0.0263',
                    A5MJ:'公式：A5单价/美金汇率',
                    A5KZ:'2200',
                    ZXS:'6',
                    C:'6',
                    K:'69',
                    G:'9.5',
                    LF:'公式：长×宽×高',
                    MZ:'14',
                    JZ:'13',

                },{
                    PM:'长方形大托盘',
                    CPHH:'YL018327',
                    GG:'68.5*51.5*3.4',
                    DW:'只',
                    ADJ:'公式：A1比率XA!克重',
                    ABL:'0.0146',
                    MJHL:'7.0000',
                    AMJ:'公式：A1单价/美金汇率',
                    AKZ:'2190',
                    MJKZ:'2190',
                    A5DJ:'公式：A5比率×A5克重',
                    A5BL:'0.0263',
                    A5MJ:'公式：A5单价/美金汇率',
                    A5KZ:'2200',
                    ZXS:'6',
                    C:'6',
                    K:'69',
                    G:'9.5',
                    LF:'公式：长×宽×高',
                    MZ:'14',
                    JZ:'13',

                },{
                    PM:'长方形大托盘',
                    CPHH:'YL018327',
                    GG:'68.5*51.5*3.4',
                    DW:'只',
                    ADJ:'公式：A1比率XA!克重',
                    ABL:'0.0146',
                    MJHL:'7.0000',
                    AMJ:'公式：A1单价/美金汇率',
                    AKZ:'2190',
                    MJKZ:'2190',
                    A5DJ:'公式：A5比率×A5克重',
                    A5BL:'0.0263',
                    A5MJ:'公式：A5单价/美金汇率',
                    A5KZ:'2200',
                    ZXS:'6',
                    C:'6',
                    K:'69',
                    G:'9.5',
                    LF:'公式：长×宽×高',
                    MZ:'14',
                    JZ:'13',

                }],
                SLWXJGBTable: [{
                    CPHH:'YL901A',
                    GG:'29*14.3',
                    DJ:'公式：比率×模具克重',
                    MJSJ:'公式：售价/美金汇率',
                    MJKZ:'420',
                    ZXS:'36',
                    C:'59.0',
                    K:'29.5',
                    G:'52.5',
                    LF:'公式：长×宽×高',
                    MZ:'16'
                },{
                    CPHH:'YL901A',
                    GG:'29*14.3',
                    DJ:'公式：比率×模具克重',
                    MJSJ:'公式：售价/美金汇率',
                    MJKZ:'420',
                    ZXS:'36',
                    C:'59.0',
                    K:'29.5',
                    G:'52.5',
                    LF:'公式：长×宽×高',
                    MZ:'16'
                },{
                    CPHH:'YL901A',
                    GG:'29*14.3',
                    DJ:'公式：比率×模具克重',
                    MJSJ:'公式：售价/美金汇率',
                    MJKZ:'420',
                    ZXS:'36',
                    C:'59.0',
                    K:'29.5',
                    G:'52.5',
                    LF:'公式：长×宽×高',
                    MZ:'16'
                }],
                totalMA:'3',
                totalSL:'3',
                queryParamsMA: {
                    pageNum:1,
                    pageSize:10
                },
                queryParamsSL: {
                    pageNum:1,
                    pageSize:10
                }
            }
        },
        methods: {
            handleExportMA() {

            },
            handleImportMA() {

            },
            handleQueryMA() {

            },
            handleUpdateMA() {
                this.openMA = true;
                this.titleMA = '密胺类批量调价设置';
                this.MALPLDJSZForm = {};
                console.log('11111111111111111111111111')
            },
            handleUpdate1(row) {
                console.log(row)
            },
            handleExportSL() {

            },
            handleImportSL() {

            },
            handleQuerySL() {

            },
            handleUpdateSL() {
                this.openSL = true;
                this.titleSL = '塑料类批量调价设置'
                this.SLLPLDJSZForm = {}
            },
            handleUpdate2(row) {
                console.log(row)
            },
            submitMA() {
                this.openMA = false;
                
            },
            cancelMA() {
                this.openMA = false;
                
            },
             submitSL() {
                this.openSL = false;
                
            },
            cancelSL() {
                this.openSL = false;
                
            }
        }
    }
</script>